package net.solosky.easyavatar.activity;

import java.util.ArrayList;
import java.util.List;

import net.solosky.easyavatar.R;
import net.solosky.easyavatar.view.FunctionMenu;
import net.solosky.easyavatar.view.FunctionMenuListAdapter;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ListView;

public class Main extends Base implements OnItemClickListener{
    @Override
    public void onCreate(Bundle savedInstanceState) {
    	super.onCreate(savedInstanceState);
    	if(!checkInitilized()){ finish(); return; }
		
        setContentView(R.layout.ui_main);
        
        ListView funcMenuView = (ListView) this.findViewById(R.id.lv_func_menu);
	     funcMenuView.setAdapter(new FunctionMenuListAdapter(this, "main"));
	     funcMenuView.setOnItemClickListener(this);
    }

	@Override
	public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
		switch(position){
			case 0:	//匹配联系人头像
				startActivity(new Intent(this, Providers.class));
				break;
				
			case 1: //设置自己头像
				startActivity(new Intent(this, MyAvatar.class));
				
			default:;
		}
	}
}